<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.js"></script>
    <style>
        .red{
            color: red;
        }
        .obj1{
            color: green;
            border: 1px solid red;
        }
        .obj2{
            background-color: aqua;
        }
        .obj3{
            width: 100px;
            height: 100px;
        }
    </style>
</head>
<body>
<div id="app">
<!--    1.字符串-->
  <div :class="str">字符串</div>
<!--    2.对象-->
    <div :class="obj">对象1</div>
    <div :class="{obj1:true,obj2:true,obj3:false}">对象2</div>
<!--    3.数组-->
    <div :class="arr">数组1</div>
    <div :class="['obj1','obj3']">数组2</div>
</div>
<script>
    Vue.config.productionTip = false
    const vm = new Vue({
        el: '#app',
        data() {
            return {
                str:'red',
                obj:{
                    obj1:true,
                    obj2:false,
                    obj3:false
                },
                arr:['obj2','obj3'],
            }
        }
    })
</script>
</body>
</html>